package com.dongdong.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.dongdong.mapper.TbOrderItemMapper;
import com.dongdong.pojo.TbOrderItem;
import com.dongdong.service.OrderItemService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Deacription TODO
 * @Author Lenovo
 * @Date 2020/12/22 16:19
 * @Version 1.0
 **/
@Service
@Component
public class OrderItemServiceImpl implements OrderItemService {

    @Resource
    private TbOrderItemMapper orderItemMapper;

    @Override
    public List<TbOrderItem> getByOrderId(Long orderId) {
        return orderItemMapper.getByOrderId(orderId);
    }

    @Override
    public TbOrderItem selectById(long parseLong) {
        return orderItemMapper.selectByPrimaryKey(parseLong);
    }

    @Override
    public void updateStatus(long id) {
        TbOrderItem orderItem = new TbOrderItem();
        orderItem.setId(id);
        orderItem.setStauts("5");
        orderItemMapper.updateByPrimaryKeySelective(orderItem);
    }
}

